<?php
require '../../../../zb_system/function/c_system_base.php';    	 		   	
require '../../../../zb_system/function/c_system_admin.php';     			 			
$zbp->Load();    	 	   	 
$action='root';        	  	
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}    	   	   
if (!$zbp->CheckPlugin('ytecn_pjax')) {$zbp->ShowError(48);die();}    				  		
$act = GetVars("act", "GET");       	 	  
if ($act === "save") {    		  	 	 
    CheckIsRefererValid();
    if (isset($_POST['ytecn'])) {
        foreach ($_POST['ytecn'] as $key => $val) {       	 		 
            $zbp->Config('ytecn_pjax')->$key = $val;     	     	
        }      	 			 
        if(!empty($_POST['limit_dir1'])){    	    	      	 	     
            $zbp->Config('ytecn_pjax')->limit_dirz1 = json_encode($_POST['limit_dir1']);    	 	 	 		    			 		  
        }else{    	    			     	    		
            $zbp->Config('ytecn_pjax')->limit_dirz1=json_encode([]);    		 	        	 		  	 
        }    			 				     			    
        if(!empty($_POST['limit_dir1'])){    			 	  	
            $zbp->Config('ytecn_pjax')->limit_dirz2 = json_encode($_POST['limit_dir2']);    	  	   	      						
        }else{    	 	  			    		  	   
            $zbp->Config('ytecn_pjax')->limit_dirz2=json_encode([]);    	  	 			     	  				
        }      	  	  		
        $zbp->SaveConfig('ytecn_pjax');      	     
        $zbp->SetHint('good', '参数已保存');      	 		 	
    }    	 				  
    Redirect('./set.php');    	 	     
}     		     
     			 		 
$blogtitle=$zbp->themeapp->name;     	  	 		
require $blogpath . 'zb_system/admin/admin_header.php';    	   			 
require $blogpath . 'zb_system/admin/admin_top.php';     	    		
$dirs=array();    		   	 	
$dirs['0']="一行四列";    				 			
$dirs['1']="一行四列带背景";    	 	 	 		
$dirs['2']="一行两列";     					  
?>
<style>
.uplod_img {width:70%;}
.uploadimg strong {cursor:pointer; background:#3A6EA5; width:15%; text-align:center; padding:5px 0; color:#fff; display:block; float:right;}
.uploadimg img {width:15%; height:auto; float:left; display:inline-block; margin-right:5%;}
.uploadimg input {float:left;}
input.sedit{ width:93%;}
table input{margin:0.25em 0;}
table input.text{padding: 2px 5px;}
table .button{padding: 2px 12px 5px 12px; margin: 0.25em 0;}
#divMain input[type="text"]{width: 80%;}
#divMain .sortline input[type="text"]{width: 40%;}
#divMain textarea{width: 80%;height: 50px;}
select {width: 300px;height: 33px;padding: 5px 10px;}
</style>
<script type="text/javascript" src="<?php echo $zbp->host;?>zb_users/theme/ytecn_pjax/script/upload.js"></script>
<div id="divMain">
    <div class="divHeader"><?php echo $blogtitle;?></div>
    <div class="SubMenu">
        <?php echo ytecn_pjax_SubMenu('set'); ?>
    </div>
    <div id="divMain2">
        <form method="post" action="?act=save">
            <input type="hidden" name="csrfToken" value="<?php echo $zbp->GetCSRFToken();?>">
            <table border="1" class="tableFull tableBorder">
                <tr>
                    <th class="td30"><p align='left'><b>标题</b><br><span class='note'></span></p></th>
                    <th>说明</th>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>logo文字</b></p></td>
                    <td><input type="text" name="ytecn[logo]" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->logo);?>" ></td>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>banner图</b></p></td>
                    <td>
                    <input name="ytecn[search]" id="edtTitle" type="text" class="ytecn_input_img" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->search);?>" />
                    <input type="button" class="ytecn_upimgbutton" value="选择图片">
                    <img class="ytecn_upimg" src="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->search);?>" style="width: 60px;">
                    </td>
                </tr>
                
                <tr>
                    <td class="td30"><p align='left'><b>banner大标题</b></p></td>
                    <td><input type="text" name="ytecn[bannertitle]" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->bannertitle);?>" ></td>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>banner摘要</b></p></td>
                    <td><input type="text" name="ytecn[bannerintro]" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->bannerintro);?>" ></td>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>首页一句话</b></p></td>
                    <td><input type="text" name="ytecn[homeone]" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->homeone);?>" ></td>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>文章默认图</b></p></td>
                    <td>
                    <input name="ytecn[proimg]" id="edtTitle" type="text" class="ytecn_input_img" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->proimg);?>" />
                    <input type="button" class="ytecn_upimgbutton" value="选择图片">
                    <img class="ytecn_upimg" src="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->proimg);?>" style="width: 60px;">
                    </td>
                </tr>

                <tr>
                    <td class="td30"><p align='left'><b>动态统计背景</b></p></td>
                    <td>
                    <input name="ytecn[blue_bg]" id="edtTitle" type="text" class="ytecn_input_img" value="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->blue_bg);?>" />
                    <input type="button" class="ytecn_upimgbutton" value="选择图片">
                    <img class="ytecn_upimg" src="<?php echo htmlspecialchars($zbp->Config('ytecn_pjax')->blue_bg);?>" style="width: 60px;">
                    </td>
                </tr>
                <tr>
                    <td class="td30"></td>
                    <td>
                    <input name="" type="Submit" class="button" value="保存" />
                    </td>
                </tr>
            </table>
        </form>

        
    </div>
</div>
<?php
require $blogpath . 'zb_system/admin/admin_footer.php';   	    	 	    	    	    			    			 			      		  			
RunTime(); 			     	  	  	  	 				    	 			 	 
?>